#include <stdio.h>
#include <stdbool.h>
#include <string.h>
/*判断一个字符串是否有子串重复构成*/

bool repeatSubStr(const char *s)
{
        int len = strlen(s);
        int left, right = 0, judge;
        while(right < len / 2){
            left = 0;           
            judge = right + 1;
            while(judge < len && left <= right){
                if(s[judge] != s[left])
                    break;
                ++left;
                ++judge;               
                if(judge == len && left > right) return true;  
                if(left > right) 
                    left = 0;          
            }
            right++;
        }
        return false;
}

int main() 
{
    const char *src = "abdabc";
    if(repeatSubStr(src))
    {
        printf("有重复字串！");
    }
    else
    {
        printf("没有重复字串！");
    }
    return 0;
}